package com.example.robertluozizhao.java.test.kotlin



/**
 * <pre>
 *     author: luozz@anjiu-tech.com
 *     time  : 2020/10/13
 *     desc  :
 * </pre>
 */
class KotlinBaseGrammar {

    companion object{
        val func = {a:Int,b:Int-> a+b}

        @JvmStatic
        fun main(args: Array<String>) {


//            println(getNumResult{ a, b -> a + b })
            println(calcNum(10,45,func))

        }


        fun calcNum(a:Int,b:Int,f:(param1:Int,param2:Int) ->Int):Int{
            return f(a,b);
        }

        fun add(a: Int,b: Int):Int{
            return a+b;
        }

        fun reduce(a: Int,b: Int):Int{
            return a-b;
        }


    }




}